package com.lago.homework2.exercise3;
/*
实现以下类：通话套餐类 特征：通话时长、短信条数、每月资费 行为: 显示所有套餐信息
 */
public class callPackage implements PhoneServerInterface{
    private int callTime;
    private int numMES;
    private int mouthFee;

    public callPackage() {

    }

    public callPackage(int callTime, int numMES, int mouthFee) {
        this.callTime = callTime;
        this.numMES = numMES;
        this.mouthFee = mouthFee;
    }

    public int getCallTime() {
        return callTime;
    }

    public void setCallTime(int callTime) {
        if (callTime >= 0) {
            this.callTime = callTime;
        }else {
            System.out.println("通话时间不合理呀！");
        }
    }

    public int getNumMES() {
        return numMES;
    }

    public void setNumMES(int numMES) {
        if (numMES >= 0) {
            this.numMES = numMES;
        }else {
            System.out.println("短信数目不合理呀！");
        }
    }

    public int getMouthFee() {
        return mouthFee;
    }

    public void setMouthFee(int mouthFee) {
        if (mouthFee >= 0) {
            this.mouthFee = mouthFee;
        }else {
            System.out.println("月租不合理呀！");
        }
    }
    public void show(){
        System.out.println("通话时长：" + getCallTime() + "短信数量：" + getNumMES() + "月租：" + getMouthFee());
    }
    @Override
    public void call(int callMinute, String cardType) {
        System.out.println("这是重写通话套餐方法，"+callMinute+" "+cardType);
    }
}
